<template>
  <div>
    <el-button @click="addColumn">新增栏目</el-button>
    <column-list v-if="columnShow === 'list'" v-on:turnPage="turnPage"></column-list>
    <add-column v-if="columnShow === 'add'"></add-column>
    <display-column v-if="columnShow === 'display'"
                     :columnId="columnId"
                     v-on:turnPage="turnPage"></display-column>
    <edit-column v-if="columnShow === 'edit'"
                  :columnId="columnId"
                  v-on:turnPage="turnPage"></edit-column>
  </div>
</template>

<script>
import addColumn from './AddColumn'
import columnList from './ColumnList'
import displayColumn from './DisplayColumn'
import editColumn from './EditColumn'

  export default {
    name: "ColumnManage",
    components: {
     addColumn:addColumn,
      columnList:columnList,
      displayColumn:displayColumn,
      editColumn:editColumn
    },
    data() {
      return {
        columnShow: 'list',
        columnId: ''
      }
    },
    methods: {

      turnPage(columnId, type) {
        this.columnId = columnId;
        this.columnShow = type;
      },

      addColumn: function () {
        this.columnShow = 'add'
      }
    }
  }
</script>

<style scoped>

</style>

